<script setup lang="ts">
import Flex from '../Flex/flex.vue';
</script>

<template>
  <Flex class="audio-bar">
    <div :class="['bar', 'bar-' + item]" v-for="item in 20" :key="item" />
  </Flex>
</template>

<style lang="scss" scoped>
@keyframes ani {
  100% {
    transform: scaleY(1.5);
  }
}
.audio-bar {
  margin-bottom: calc(80px + env(safe-area-inset-bottom));
}
.bar {
  width: 4px;
  height: 20px;
  background-color: #4059fd;
  border-radius: 10px;
  margin: 0 2px;
  animation: ani 0.3s ease infinite alternate;
}
@for $i from 1 through 20 {
  .bar-#{$i} {
    animation-delay: random() * 5s;
  }
}
</style>
